<extend name="Public/base" />

<block name="body">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>
    <div class="cf">
        <div class="fl">
            <form action="{:U('index')}" method="POST">
                <input type="text" name="keywords" class="text input-2x" value="{:I('keywords')}" placeholder="消息标题">
                添加时间：<input type="text" id="start_date" name="start_date" class="text input-2x" value="{$start_date}" placeholder="开始时间" /> 至
                <input type="text" id="end_date" name="end_date" class="text input-2x" value="{$end_date}" placeholder="结束时间" />&nbsp; &nbsp;

                <button class="btn" type="submit">筛选</button><!--            <button class="btn ajax-post confirm" url="{:U('changeStatus?method=deleteUser')}" target-form="ids">删 除</button>-->
            </form>
        </div>

        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <a class="btn" href="{:U('add')}">新 增</a>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table class="">
            <thead>
                <tr>
                    <th class="">消息ID</th>
                    <th class="">消息标题</th>
                    <th class="">创建时间</th>
                    <th class="">操作</th>

                </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td>{$vo.msg_id} </td>
                        <td>{$vo.title}</td>

                        <td>{$vo.create_time}</td>
                        <td>

                            <a href="{:U('add',array('id'=>$vo['msg_id']))}" class="">编辑</a>
                            <a href="{:U('del',array('id'=>$vo['msg_id']))}" class="confirm ajax-get">删除</a>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="20" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
        //搜索功能
        $("#search").click(function () {
            var url = $(this).attr('url');
            var query = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function (e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        $('#start_date').datetimepicker({
            format: 'yyyy-mm-dd',
            language: "zh-CN",
            minView: 2,
            autoclose: true
        });
        $('#end_date').datetimepicker({
            format: 'yyyy-mm-dd',
            language: "zh-CN",
            minView: 2,
            autoclose: true
        });
        //导航高亮
        highlight_subnav("{:U('Msg/index')}");
    </script>
</block>
